package com.dstz.demo.rest.controller;

import com.dstz.base.api.response.impl.ResultMsg;
import com.dstz.base.rest.BaseController;
import com.dstz.demo.core.manager.AClClbManager;
import com.dstz.demo.core.model.AClClb;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/sys/aclclb")
public class AClClbController extends BaseController<AClClb> {
    @Resource
    AClClbManager aClClbManager;
    @Override
    protected String getModelDesc() {
        return null;
    }
    @PostMapping("/updates/{id}")
    public ResultMsg updates(@PathVariable("id") String id){
        String[] s=id.split(",");
        AClClb aClClb=new AClClb();
        aClClb.setId(s[0]);
        aClClb.setZt(s[1]);
        aClClb.setDistinguishtype("1");
        aClClbManager.updates(aClClb);
        return getSuccessResult("提交成功");
    }
    @GetMapping("/findById/{id}")
    public AClClb findById(@PathVariable("id") String id){
        AClClb aClClb=aClClbManager.findById(id);
        return aClClb;
    }
    @GetMapping("/ById/{id}")
    public AClClb byid(@PathVariable("id") String id){
        System.out.println(id);
        AClClb aClClb=aClClbManager.ById(id);
        return aClClb;
    }
    @GetMapping("/ids/{wlbm}")
    public AClClb ids(@PathVariable("wlbm") String wlbm){
       AClClb aClClb=aClClbManager.ids(wlbm);
       return aClClb;
    }
}
